﻿<%@ Page Language="C#" MasterPageFile="~/Users/Users.Master" AutoEventWireup="true" CodeBehind="ProgramDetail.aspx.cs" Inherits="Pantry.Web.Users.ProgramDetail" Title="Program detail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<link rel="stylesheet" href="Resources/css/lachv.css" />
	<title>Program Detail</title>
	<link rel="STYLESHEET" type="text/css" href="Resources/pop-up/popup-contact.css"/>
	<script type="text/javascript" src="Resources/pop-up/fg_moveable_popup.js"></script>
	<script type="text/javascript" src="Resources/pop-up/Alert/javaAlert.js"></script>
    <script src="Resources/pop-up/gen_validatorv31.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:Label ID="LabelNotify" runat="server" Text=""></asp:Label>
	<div class="g_12">
	
		<div class="widget_header">
			
			<h4 class="widget_header_title wwIcon i_16_data">Program Details</h4>						
			<a href="ViewListProgram.aspx">
			    <input type="button" value="Back" class="simple_buttons right_buttons" />
			</a>
            <asp:Button ID="ButtonSave" runat="server" Text="Save" CssClass="simple_buttons right_buttons" 
                                        onclick="ButtonSaveClick" />
            <asp:Button ID="ButtonDeactivate" runat="server" Text="In-active" 
                                        CssClass="simple_buttons right_buttons" 
                onclick="ButtonDeactivateClick" OnClientClick="return confirmDialogue();" />
			<div class="clear"></div>
		</div>
		<div class="widget_contents noPadding">	
			<div class="form_contents">
			
				<div class="form_enter">
				    <asp:TextBox ID="TextBoxProgramId" runat="server" Visible="False"></asp:TextBox>
				    <asp:TextBox ID="TextBoxIsActive" runat="server" Visible="False"></asp:TextBox>
					<div class="lable_first_input">Program Name</div>
					<div class="form_input" id="ProgramName">
                        <asp:TextBox ID="TextBoxProgramName" runat="server" CssClass="simple_field" ></asp:TextBox>                                    
					    
                        
					</div>
				</div>
				<div class="form_enter">
					<div class="lable_first_input">Contact</div>
					<div class="form_input_short" id="Contact">
					    <asp:TextBox ID="TextBoxContact"  runat="server" CssClass="simple_field" 
                             Enabled="False"></asp:TextBox>
                            <asp:HiddenField ID="HiddenContactId" runat="server" />
					</div>
					<a href='javascript:fg_popup_form("fg_formContainer","","fg_backgroundpopup");'>
						<div class="link_look_up" >Look up</div>
					</a>
				</div>
				<div class="clear"></div>
				<div class="form_enter">
					<div class="lable_first_input">Description</div>
					<div class="form_input" id="Description">
                        <asp:TextBox ID="TextBoxDescription" runat="server" CssClass="simple_field" ></asp:TextBox>
					</div>
				</div>
			</div>
		</div>	
	</div>
				
    <!--Begin pop-up-->
	<div style="display: none; left: 300px;" id="fg_formContainer">
		<div id="fg_container_header">
			<div id="fg_box_Title">List Contact</div>
			<div id="fg_box_Close">
				<a href="javascript:fg_hideform('fg_formContainer','fg_backgroundpopup');">Close(X)</a>
			</div>
		</div>
		<div>
			<form id="pop-up_contact" action="javascript:fg_submit_form()" method="post" accept-charset="UTF-8">
			
			<div class="g_12">
					<div class="widget_contents noPadding">
						<table class="tables">
							<thead>
								<tr>
								    <th>Select</th>
									<th>First Name</th>
									<th>Last Name</th>
									<th>Activate</th>
								</tr>
							</thead>
							<tbody>
							    <asp:Repeater runat="server" ID="RepeaterContacts">
    							    <ItemTemplate>
								        <tr>
								            <td>
								                <input type="radio" name="ContactId" value="<%# Eval("ContactId") %>"/>
								                <input type="hidden" name="FirstName" value="<%# Eval("FirstName") %>"/>
								                <input type="hidden" name="SurName" value="<%# Eval("SurName") %>"/>								                
								            </td>
									        <td><%# Eval("FirstName") %></td>
									        <td><%# Eval("SurName") %></td>
									        <td><%# Eval("IsActive").ToString() %></td>
								        </tr>
    							    </ItemTemplate>
							    </asp:Repeater>
							</tbody>
						</table>
					</div>
				</div>
				<a href="javascript:fg_select('fg_formContainer','fg_backgroundpopup');">
                    <input type="button" value="Select" runat="server" class="simple_buttons pop-up_buttons"/>
                </a>                             
			
			</form>
		</div>
	</div>

	<div id="fg_backgroundpopup">
	</div>	
	<!--End pop-up-->	
	
	<script type="text/javascript">
	    function confirmDialogue(){
	        if(confirm('Do you want to make this Program in-active?'))
	        return true;
	        return false;
	    }
	    
	    
		var frmvalidator  = new Validator("aspnetForm");
		//frmvalidator.EnableOnPageErrorDisplay();
		//frmvalidator.EnableMsgsTogether();
		var programName = document.getElementById('ProgramName').getElementsByTagName("input")[0].id;
		frmvalidator.addValidation(programName,"req","Please provide your Program Name");
		
		var contact = document.getElementById('Contact').getElementsByTagName("input")[0].id;
		frmvalidator.addValidation(contact,"req","Please provide your ContactId");		
	</script>
	</asp:Content>
